<?php
if(!isset($_SESSION)) 
	{ 
		session_start(); 
	}
	ob_start();
	if(isset($_REQUEST['btnLogin'])){
		
		include 'operations/connection.php';
	  	$username =  $_REQUEST['txtUser'];
	   	$password = md5($_REQUEST['txtPass']);
	   
		
		include "operations/login-result.php";
			
		if ($username=="" || $password=""){
			
			$errorMessage = "Fill up all fields.";
			$_SESSION['error']="Fill up all fields.";
			header( 'Location: login.php' );
		}else {
			echo authenticate($username, $_REQUEST['txtPass'] );
		}
		
	}
 ob_flush(); ?>